package pl.com.like.sequoia.web.service;

import pl.com.like.sequoia.exceptions.LogicalException;
import pl.com.like.sequoia.model.bio.BioObjectHandler;
import pl.com.like.sequoia.web.vo.IPdbObjectDataHandler;
import pl.com.like.sequoia.web.vo.PdbObjectDataHandler;
import pl.com.like.sequoia.web.vo.SearchType;

public class PdbInformator implements IPdbInformator {

	private ISearchService searchService;

	/**
	 * {@inheritDoc}
	 * 
	 * @throws LogicalException
	 */
	public IPdbObjectDataHandler getObjectInfo(String id) throws LogicalException {
		BioObjectHandler object = searchService.findBioObject(id, SearchType.PDB);
		PdbObjectDataHandler handler = new PdbObjectDataHandler(object);
		return handler;
	}

	public ISearchService getSearchService() {
		return searchService;
	}

	public void setSearchService(ISearchService searchService) {
		this.searchService = searchService;
	}

	// public List<IPdbObjectDataHandler> getObjects(String pattern, Integer size) throws LogicalException {
	// List<IPdbObjectDataHandler> resultList = new ArrayList<IPdbObjectDataHandler>();
	// List<BioObjectHandler> objectList = searchService.findBioObjectList(pattern, SearchType.PDB);
	// if (objectList != null && !objectList.isEmpty()) {
	// for (BioObjectHandler bioItem : objectList) {
	// PdbObjectDataHandler handler = new PdbObjectDataHandler(bioItem);
	// resultList.add(handler);
	// }
	// }
	//
	// return resultList;
	// }
}
